<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="/style/basic_layout.css" rel="stylesheet" type="text/css">
    <link href="/style/common_style.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="/js/jquery/jquery.js"></script>
    <script type="text/javascript" src="/js/plugins/artDialog/jquery.artDialog.js?skin=blue"></script>
    <script type="text/javascript" src="/js/commonAll.js"></script>
    <title>叩丁狼教育PSS（演示版）-账户管理</title>
    <style>
        .alt td{ background:black !important;}
    </style>
    <script>
        $(function () {
            //当点击btn_load的按钮时候
            $(".btn_load").click(function () {
                //会触发一个回话框
                $.dialog({
                    title:"提示",
                    content:"确定要加载权限吗",
                    icon :"face-smile",
                    //当点击ok的时候会触动以下的函数
                    ok: function () {
                        //权限加载中的时候会转圈
                        var dialog = $.dialog({
                            title:"提示",
                        })
                        //之后会发送ajax请求
                        $.post("/permission/load.do",function (data) {
                            dialog.content("添加成功")
                            //判断返回来的success是true还是false
                            if(data.success){
                                dialog.button({
                                    name:"确定",
                                    callback:function () {
                                        window.location.href="/permission/list.do"
                                    }
                                })
                            }else{
                                dialog.button({
                                    name:"确定",
                                })

                            }
                            
                        })

                    },
                    cancel:true
                })
                
            })
            
        })


    </script>
</head>
<body>
<form id="searchForm" action="#" method="post">
    <div id="container">
        <div class="ui_content">
            <div class="ui_text_indent">
                <div id="box_border">
                    <div id="box_top">搜索</div>
                    <div id="box_center">
                    </div>
                    <div id="box_bottom">
                        <input type="button" value="查询" class="ui_input_btn01"/>
                        <input type="button" value="权限加载" class="ui_input_btn01 btn_load" data-url="/permission/load.do"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="ui_content">
            <div class="ui_tb">
                <table class="table" cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
                    <tr>
                        <th width="30"><input type="checkbox" id="all" /></th>
                        <th>编号</th>
                        <th>权限名称</th>
                        <th>权限表达式</th>
                        <th>操作</th>
                    </tr>
                    <tbody>
                <c:forEach items="${pageResult.list}" var="c">
                    <tr>
                        <td><input type="checkbox" name="IDCheck" class="acb" /></td>
                        <td>${c.id}</td>
                        <td>${c.name}</td>
                        <td>${c.expression}</td>
                        <td>
                            <a href="javascript:;" class="btn_delete" data-url="/permission/delete.do?id=${c.id}">删除</a>
                        </td>
                    </tr>
                </c:forEach>
                    </tbody>
                </table>
            </div>
            <div class="ui_tb_h30">
                <%@include file="../commons/commsn_page.jsp"%>

            </div>
        </div>
    </div>
</form>
</body>
</html>

